-
Notifications
You must be signed in to change notification settings - Fork 7.5k
drivers: sensor: Add LPC internal temperature sensor #90418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f41dec2
to
0b06d2e
Compare
The LPC ADC has a dedicated input channel for an on-chip temperature sensor. This commit adds support for defining and reading from that channel. Signed-off-by: Wilkins White <ww@novadynamics.com>
0b06d2e
to
c5ee8a6
Compare
c5ee8a6
to
d31bd1d
Compare
Fixed duplicated tag |
d31bd1d
to
8ca843f
Compare
Fix line length and bracket failures |
8ca843f
to
29898fc
Compare
Fixed blank line at end of yaml file |
29898fc
to
0b4d31c
Compare
Fix C99 style comment |
The LPC ADC has a dedicated input channel for an on-chip temperature sensor. This commit adds a sensor driver for reading the die temperature. Signed-off-by: Wilkins White <ww@novadynamics.com>
This commit adds adc0 for the NXP LPC55S1x SoC. Signed-off-by: Wilkins White <ww@novadynamics.com>
This commit adds overlays for the lpcxpresso55s16 to read die temperature from the dedicated ADC channel. Signed-off-by: Wilkins White <ww@novadynamics.com>
0b4d31c
to
344ec83
Compare
Fixed the bracket again, and I installed the pre-commit git hook so fingers crossed... |
|
@@ -225,6 +225,16 @@ static int mcux_lpadc_channel_setup(const struct device *dev, | |||
} | |||
} else if (channel_cfg->reference == ADC_REF_EXTERNAL0) { | |||
LOG_DBG("ref external0"); | |||
# if defined(FSL_FEATURE_LPADC_HAS_INTERNAL_TEMP_SENSOR) | |||
} else if (channel_cfg->reference == ADC_REF_INTERNAL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use IS_ENABLED(FSL_FEATURE_LPADC_HAS_INTERNAL_TEMP_SENSOR)
instead of #if
#include <zephyr/drivers/adc.h> | ||
|
||
#include <zephyr/logging/log.h> | ||
LOG_MODULE_REGISTER(temp_lpc, CONFIG_SENSOR_LOG_LEVEL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does clang-format not sort all the includes? Why is the LOG_MODULE_REGISTER needed to be between the includes?
|
||
#include <fsl_lpadc.h> | ||
|
||
BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) <= 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You already filtered building this file in CMake, shouldn't this be == 1
?
Closing due to #90381 |
The LPC ADC has a dedicated input channel for an on-chip temperature sensor. This pull request does the following:
This was developed and tested on an LPC5516, but it should work on the other SoCs in the LPC family as well as other chips that use the LPADC such as the RT6XX series.